package tagging;

import java.io.IOException;

import tagging.Parser.ParserException;

public class PosTagging {
  public static TrainingSet train_;
  public static TestSet test_;

  public static void main(String[] args) {
    if (args.length != 2) {
      System.err.println("USAGE: Baseline <training-file> <test-file>");
      System.exit(0);
    }

    // Parsing command line arguments.

    try {
      train_ = new TrainingSet(args[0]);
      train_.process();
    } catch (Parser.ParserException e) {
      System.err.println(e.getMessage());
      System.exit(1);
    }
    System.out.println("Completed parsing training file.");
    System.out.println("********************************\n");

    test_ = null;
    try {
      test_ = new TestSet(args[1]);
      test_.process(train_);
    } catch (ParserException pe) {
      System.err.println(pe.getMessage());
      System.exit(0);
    } catch (IOException ie) {
      System.err.println(ie.getMessage());
      System.exit(0);
    }

    System.out.println("Done processing test data.");
    System.out.println("**************************");
  }
}
